package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Mobile   string `gorm:"type:varchar(30)"`
	Password string `gorm:"type:varchar(32)"`
}

func (u *User) UserFindById(db *gorm.DB, id uint) error {
	return db.Debug().Where("id=?", id).Error
}

func (u *User) UserAdd(db *gorm.DB) error {
	return db.Debug().Create(&u).Error
}
